# -*- coding:utf-8 -*-
from scrapy import Request
from scrapy.spiders import Spider
import json, browsercookie

class DoubanKeepSpider(Spider):
    name = 'doubankeep'

    def __init__(self):
        cookiejar = browsercookie.chrome()
        self.cookie_dict = {}
        for cookie in cookiejar:
            if cookie.domain == ".douban.com" or cookie.domain == "www.douban.com":
                self.cookie_dict[cookie.name] = cookie.value

    def start_requests(self):
        url = 'https://www.douban.com/people/157942565/'
        yield Request(url, cookies=self.cookie_dict)

    def parse(self, response, **kwargs):
        print('--')